package com.koron.system.menu.mapper;

import com.koron.bean.base.BaseQueryBean;
import com.koron.bean.system.menu.MenuBean;
import com.koron.bean.system.menu.MenuFuncBean;
import com.koron.system.common.util.MenuTreeVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component
public interface MenuMapper {

    int insertMenu(MenuBean menuBean);

    int updateMenu(MenuBean menuBean);

    List<MenuTreeVo> queryMenuTree(MenuBean menuBean);

    List<MenuTreeVo> queryAppMenuTree(MenuBean menuBean);

    List<MenuTreeVo> queryLineAppMenuTree(MenuBean menuBean);

    int deleteMenuById(@Param("id")String id);

    int deleteMenuList(@Param("ids") List<String> ids);

    MenuBean querySingleMenu(MenuBean menuBean);

    List<MenuBean> queryMenuList(@Param("menuBean") MenuBean menuBean, @Param("queryBean") BaseQueryBean queryBean);

    Long queryMenuListCount(@Param("menuBean") MenuBean menuBean);

    int insertMenuFunc(@Param("list")List<MenuFuncBean> menuFuncList);

    int deleteMenuFuncList(@Param("menuIds")List<String> menuIds);

    int deleteMenuFuncByMenuId(@Param("menuId")String menuId);

    List<MenuBean> queryAll();

    List<MenuFuncBean> queryMenuFunAll();

    int updateBatch(@Param("defectBeans") List<MenuBean> defectBeans);

    int updateMenFunBatch(@Param("defectBeans") List<MenuFuncBean> defectBeans);

    MenuBean queryByCode(@Param("code")String code);
}
